package com.itheima.Arrays;

import java.util.Arrays;

public class ArrayDemo {
    public static void main(String[] args) {
        //toString 返回指定数组的内容的字符串表示形式数组就变成字符串了 Arrays.toString(数组)
        int[] arr = {2,9,3,7,5,6,4};
        String s = Arrays.toString(arr);
        System.out.println(s);//[1, 2, 3, 4, 5, 6, 7]


        //sort快速排序
        int [] arr1 = {3,2,4,6,7};
      Arrays.sort(arr1);
      System.out.println(Arrays.toString(arr1));


      //二分查找
        int[] arr2 = {1, 2, 3, 4, 5, 6, 7,8};
        int i = Arrays.binarySearch(arr2, 0);
        System.out.println(i);
    }
}
